package com.hf.research.controller;

import com.hf.research.entity.ResearchEntity;
import com.hf.research.service.ResearchService;
import com.hongfan.common.model.ResultMsg;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zcs
 * @since 2023/10/18
 */
@RestController
@RequestMapping("/research")
public class ResearchController {

    @Resource
    ResearchService researchService;

    /**
     * 获取科研的基本信息
     */
    @GetMapping(value = "/getList")
    public ResultMsg<List<ResearchEntity>> getList() {
        return ResultMsg.success(researchService.getList());
    }


    /**
     * 获取科研的基本信息
     */
    @GetMapping(value = "/get")
    public ResultMsg<ResearchEntity> get(Integer id) {
        return ResultMsg.success(researchService.get(id));
    }


}
